package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagOrderReadRecordDtoMapper;
import com.starlink.model.domain.SchoolbagOrderReadRecordDO;
import com.starlink.model.vo.SchoolbagOrderReadRecordVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagOrderReadRecordConvert {

    public static List<SchoolbagOrderReadRecordVO> buildSchoolbagOrderReadRecordVoList(List<SchoolbagOrderReadRecordDO> schoolbagOrderReadRecordDOList) {
        if (CollectionUtils.isEmpty(schoolbagOrderReadRecordDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagOrderReadRecordVO> schoolbagOrderReadRecordVOList = new ArrayList<>();
        for (SchoolbagOrderReadRecordDO schoolbagOrderReadRecordDO : schoolbagOrderReadRecordDOList) {
            schoolbagOrderReadRecordVOList.add(SchoolbagOrderReadRecordDtoMapper.INSTANCE.do2VO(schoolbagOrderReadRecordDO));
        }

        return schoolbagOrderReadRecordVOList;
    }
}
